{extend name="template/base" /}
{block name="content"}
<div class="page-container">
<div class="toptip">
    <h2>提示：</h2>
    <p>
     设立知识点并命名，选择所属科目和章节，状态默认启用<br>
    </p>
  </div>
  <legend><i class="Hui-iconfont">&#xe600;</i>章节管理</legend>
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label  f-l ml-20"><span class="c-red">*</span>知识点名称：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <input type="text" class="input-text" placeholder="知识点名称" name="k_name" value="{$vo.k_name ?? ''}"  datatype="*" nullmsg="请填写知识点名称">
            </div>
            <div class="col-xs-offset-4"></div>
        </div>
		 <div class="row cl">
            <label class="form-label  f-l ml-20">所属科目：</label>
            <div class="formControls  col-xs-8 col-sm-5">
                <div class="select-box">
                    <select name="k_subjectid" class="select" datatype="*" nullmsg="请选择所属科目">
						<option value>请选择科目</option>
                        {volist name='subject' id='sj'}
                        <option value="{$sj.id}" {$vo.k_subjectid==$sj.id ? 'selected' : ''}>{$sj.s_name}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="col-xs-offset-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label f-l ml-20"><span class="c-red">*</span>所 属 章 节：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <div class="select-box">
                    <select name="k_sectionid" id="k_sectionid" class="select" datatype="*" nullmsg="请选择所属章节">
						<option value>请选择章节</option>
                        {volist name='sections' id='st'}
                       <option value="{$st.id}" {$vo.k_sectionid==$st.id ? 'selected' : ''}>{$st.se_name}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="col-xs-offset-4"></div>
        </div>
		<div class="row cl">
            <label class="form-label  f-l ml-20 ">启用状态：</label>
            <div class="formControls col-xs-8 col-sm-5 skin-minimal">
				<div class="radio-box">
					<input type="radio" id="status-ok" name="status" value="1" {$vo.status ? 'checked' : ''}>
					<label for="status-ok">启用</label>
				</div>	
				<div class="radio-box">
					<input type="radio" id="status-no" name="status" value="0" {$vo.status ? '' : 'checked'} >
					<label for="status-no">禁用</label>
				</div>	
            </div>
            <div class="col-xs-offset-4"></div>
        </div>
				

         <div class="row cl">
            <label class="form-label f-l ml-20">描述：</label>
            <div class="formControls col-xs-8 col-sm-5">
                <textarea class="textarea" placeholder="" name="k_describe" onKeyUp="textarealength(this,100)">{$vo.k_describe ?? ''}</textarea>
                <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
            </div>
             <div class="col-xs-offset-4"></div>
        </div>


        <div class="row cl">
            <div class="ml-save">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;保 存&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
    $(function () {
        $("[name='sectionid']").find("[value='{$vo.sectionid ?? ''}']").attr("selected", true);

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>

<script type="text/javascript">

	$(document).ready(function(){
			common();
		});
</script>

{/block}
